<?php

namespace Organize\Controllers;

use Platform\Controller;
use Platform\Models\Organize\Organize;

class BaseOrganizeController extends Controller
{
    protected $phone_preg = "/^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$/";
    protected $cache_area_key;

    /** @var Leaders\ null  */
    protected $leader;

    /** @var Organize \null */
    protected $organize;

    protected $auth_type = 'organize';
    protected $app_type = null;

    public function __construct()
    {
        $token = auth($this->auth_type)->getToken();
        if ($token){
            if (auth($this->auth_type)->user()) {
                $this->leader = auth($this->auth_type)->user() ;
                $this->organize = $this->leader->organize ;
            }
        }
    }
}